<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html><head><title>Programming in Lua : 22</title>
<link rel="stylesheet" type="text/css" href="pil.css">
</head>
<body>
<p class="warning">
<A HREF="contents.html"><IMG TITLE="Programming in Lua (first edition)" SRC="capa.jpg" ALT="" ALIGN="left"></A>This first edition was written for Lua 5.0. While still largely relevant for later versions, there are some differences.<BR>The third edition targets Lua 5.2 and is available at <A HREF="http://www.amazon.com/exec/obidos/ASIN/859037985X/theprogrammil3-20">Amazon</A> and other bookstores.<BR>By buying the book, you also help to <A HREF="../donations.html">support the Lua project</A>.
</p>
<table width="100%" class="nav">
<tr>
<td width="10%" align="left"><a href="21.3.html"><img border="0" src="left.png" alt="Previous"></a></td>
<td width="80%" align="center"><a href="contents.html"><font face="Helvetica,Arial,sanserif">
<font color="gray">Programming in </font><font color="blue"> Lua</font>
</font></a></td>
<td width="10%" align="right"><a href="22.1.html"><img border="0" src="right.png" alt="Next"></a></td>
</tr>
<tr>
<td width="10%" align="left"></td>
<td width="80%" align="center"><a href="contents.html#P3">Part III. The Standard Libraries</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="contents.html#22">Chapter 22. The Operating System Library</a></td>
<td width="10%" align="right"></td></tr>
</table>
<hr/>
<h1>22 &ndash; The Operating System Library</h1>

<p>The Operating System library
includes functions for file manipulation,
for getting the current date and time,
and other facilities related to the operating system.
It is defined in table <code>os</code>.
This library pays a price for Lua portability.
Because Lua is written in ANSI C,
it uses only the functions that the ANSI standard defines.
Many OS facilities, such as directory manipulation and sockets,
are not part of this standard
and therefore the system library does not provide them.
There are other Lua libraries,
not included in the main distribution,
that provide extended OS access.
Examples are the <code>posix</code> library,
which offers all functionality of the POSIX.1 standard to Lua;
and <code>luasocket</code>, for network support.

<p>For file manipulation,
all that this library provides is an
<code>os.rename</code> function, that changes the name of a file;
and <code>os.remove</code>, that removes (deletes) a file.

<hr/>
<table width="100%" class="nav">
<tr valign="top">
<td width="90%" align="left">
<small>
  Copyright &copy; 2003&ndash;2004 Roberto Ierusalimschy.  All rights reserved.
</small>
</td>
<td width="10%" align="right"><a href="22.1.html"><img border="0" src="right.png" alt="Next"></a></td>
</tr>
</table>


</body></html>

